function clone(object) 
{
  function OneShotConstructor(){}
  OneShotConstructor.prototype = object;
  return new OneShotConstructor();
}

var Tree = {}
var Node = function()
{}
Node.prototype.getNodeName = function(){}

//--------------------------------------------------------------------------- Nota: seria mejor que name,key fuera en Node, pero ya que, no hay time
var InternalNode = function(name,nodeKey,keyList)
{
	this.nodeName = name;
	this.key = nodeKey;
	this.keyList = keyList;
	this.children = [];
}
InternalNode.prototype = clone(Node.prototype);
InternalNode.prototype.constructor = InternalNode;
InternalNode.prototype.getChildren = function()
{
	return this.children;
}
InternalNode.prototype.addChildren = function(childNode)
{
	this.children.push(childNode);
}
//-----------------------------------------------------------------------------
var FinalNode = function(name,nodeKey)
{
	this.nodeName = name;
	this.key = nodeKey;
	this.dataHash = [[]];
}
FinalNode.prototype = clone(Node.prototype);
FinalNode.prototype.constructor = FinalNode;
FinalNode.prototype.addHashNames = function(hashNames)
{
	if (this.dataHash.length == 1)
	{
		this.dataHash.unshift(hashNames);
	}
}
FinalNode.prototype.addValue = function(name,value)
{
	if(this.dataHash.length > 1){
		insertIndex = this.dataHash[0].indexOf(name);
		this.dataHash[1][insertIndex] = value;
	}
}
